



//<Sensor_initialize>

#include <Wire.h>
#include <dht11.h>


dht11 DHT11;
#define DHT11_PIN 2 //PIN2 DHT11

#define BMP085_address 0x77 //I2C BMP085
const unsigned char OSS = 0; //Software_oversampling_setting = (0,1,2,3)

int BH1750_address = 0x23;
byte buff[2];
int wind_cout;


//set the variable type
 float temperature;
 float pressure;
 float humidity;
 float wind_speed;
 int dir; // direction
 uint16_t lux=0; // lumen,lm


//Calibration values
//Part in <Sersor_Set>
  int ac1;
  int ac2;
  int ac3;
  unsigned int ac4;
  unsigned int ac5;
  unsigned int ac6;
  int b1;
  int b2;
  int mb;
  int mc;
  int md;
  long b5;
//////////////


String inputString = ""; // Saveing string
boolean stringComplete = false; // judge string input completely
/////////////

////////////////////////////////
////////////////////////////////

void setup()
{
  Serial.begin(9600);
  Serial2.begin(115200);
  Serial3.begin(9600);
  Wire.begin();
  bmp085Calibration();
  pinMode(1,INPUT); //select the pinMode is INPUT
}

int t;

void loop()
{
  //function in the <Sensor_Set>
  sensor_work();
  //function in the <Sensor_data_send>
  Sent_temperature_data();
  Sent_lux_data();
  Sent_press_data();
  Sent_wind_speed_data();
  Sent_wind_dir_data();
  Sent_humidity_data ();

    for(t=0;t<=10;t++)//delay 10s
    {
      delay(1000);
    }
}
